﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- 禁止浏览器从本地缓存中调阅页面。-->
<meta http-equiv="pragram" content="no-cache">
<!--网页不保存在缓存中，每次访问都刷新页面。
<meta http-equiv="cache-control" content="no-cache, must-revalidate"> -->
<base href="<%=basePath%>">

<!-- jsp文件头和头部 -->
<%@ include file="top.jsp"%>
<style type="text/css">
.commitopacity {
	position: absolute;
	width: 100%;
	height: 100px;
	background: #7f7f7f;
	filter: alpha(opacity = 50);
	-moz-opacity: 0.8;
	-khtml-opacity: 0.5;
	opacity: 0.5;
	top: 0px;
	z-index: 99999;
}

.headbg {
	background: url(static/img/title-bg.jpg) repeat;
	width: 100%;
}
</style>

<!-- 即时通讯 -->
<link rel="stylesheet" type="text/css"
	href="plugins/websocketInstantMsg/ext4/resources/css/ext-all.css">
<link rel="stylesheet" type="text/css"
	href="plugins/websocketInstantMsg/css/websocket.css" />
<script type="text/javascript"
	src="plugins/websocketInstantMsg/ext4/ext-all-debug.js"></script>
<script type="text/javascript"
	src="plugins/websocketInstantMsg/websocket.js"></script>
<!-- 即时通讯 -->

</head>
<body>

	<!-- 页面顶部¨ -->
	<%@ include file="head.jsp"%>
	<div id="websocket_button"></div>
	<div class="container-fluid" id="main-container">
		<a href="#" id="menu-toggler"><span></span></a>
		<!-- menu toggler -->

		<!-- 左侧菜单 -->
		<%@ include file="left.jsp"%>

		<div id="main-content" class="clearfix">

			<div id="jzts"
				style="display: none; width: 100%; position: fixed; z-index: 99999999;">
				<div class="commitopacity" id="bkbgjz"></div>
				<div style="padding-left: 70%; padding-top: 1px;">
					<div style="float: left; margin-top: 3px;">
						<img src="static/images/loadingi.gif" />
					</div>
					<div style="margin-top: 5px;">
						<h4 class="lighter block red">&nbsp;加载中 ...</h4>
					</div>
				</div>
			</div>

			<div>
				<iframe name="mainFrame" id="mainFrame" frameborder="0" src="tab.do"
					style="margin: 0 auto; width: 100%; height: 100%;"></iframe>
			</div>

		</div>
		<!-- #main-content -->
	</div>
	<!--/.fluid-container#main-container-->
	<!-- basic scripts -->

	<!-- 引入 -->
	<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
	<script src="static/js/bootstrap.min.js"></script>
	<script src="static/js/ace-elements.min.js"></script>
	<script src="static/js/ace.min.js"></script>
	<!-- 引入 -->


	<script type="text/javascript" src="static/js/jquery.cookie.js"></script>
	
	<!--引入属于此页面的js -->
	<script type="text/javascript" src="static/js/myjs/index.js"></script>
	<script type="text/javascript">
	var rootPath = getRootPath();

	function getRootPath() {
		// 获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
		var curWwwPath = window.document.location.href;
		// 获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
		var pathName = window.document.location.pathname;
		var pos = curWwwPath.indexOf(pathName);
		// 获取主机地址，如： http://localhost:8083
		var localhostPaht = curWwwPath.substring(0, pos);
		// 获取带"/"的项目名，如：/uimcardprj
		var projectName = pathName.substring(0,
				pathName.substring(1).indexOf('/') + 1);
		return (localhostPaht + projectName);
	}
	validToken();
	var param ={};
	param['USER_ID'] ="${user.USER_ID}";
	
	
	function validToken(){
		$.ajax({
	        type : "post",
	        async : false,
	        url : rootPath+"//validToken", //实际上访问时产生的地址为
	        data : param,
	        cache : false, //默认值true
	        dataType : "json",
	        success : function(callback){
	    		var code = callback.code;
	    		var msg = callback.msg;
	    		var token = callback.token;
	    		
	    		console.log("code:"+code+",msg:"+msg+",token:"+token);
	    		localStorage.setItem('token',token); // 存入一个值
	    		
	    		console.log("token:"+localStorage.getItem('token')); //获取一个值
	        },
	        error:function(){
	            //alert("error");
	        }
	    });
	}
	
	
	
	
	//弹出框
	//个人信息
	function personInfo(){
			 top.jzts();
			 var diag = new top.Dialog();
			 diag.Drag=true;
			 diag.Title ="个人信息";
			 diag.URL = '<%=basePath%>user/goUserInfoPage.do';
			 diag.Width = 450;
			 diag.Height = 600;
		 	 diag.CancelEvent = function(){ //关闭事件
				diag.close();
			 };  
			
			 diag.show();
		}
	//密码修改
	function pwdUpdate(){
		 top.jzts();
		 var diag = new top.Dialog();
		 diag.Drag=true;
		 diag.Title ="密码修改";
		 diag.URL = '<%=basePath%>user/goUpdatePwdPage.do';
		 diag.Width = 450;
		 diag.Height = 300;
	 	 diag.CancelEvent = function(){ //关闭事件
			diag.close();
		 };  
		
		 diag.show();
	}
	
	</script>

</body>
</html>
